import axios from './axios';

export function apiLogin(data) {
	return axios({
		url: '/api/login',
		method: 'post',
		data,
	});
}

export function apiRegister(data) {
	return axios({
		url: '/api/register',
		method: 'post',
		data,
	});
}

// 用户相关

export function apiGetUserList(data) {
	return axios({
		url: '/api/user/getUserList',
		method: 'get',
		data,
	});
}

export function apiDeleteUser(data) {
	return axios({
		url: '/api/user/deleteUser',
		method: 'post',
		data,
	});
}

export function apiUpdateUser(data) {
	return axios({
		url: '/api/user/updateUser',
		method: 'post',
		data,
	});
}

//项目相关

export function apiGetProjectList(data) {
	return axios({
		url: '/api/proj/getProjectList',
		method: 'get',
		data,
	});
}

export function apiGetProjectDetail(data) {
	return axios({
		url: '/api/proj/' + data.id,
		method: 'get',
		data,
	});
}

export function apiDeleteProject(data) {
	return axios({
		url: '/api/proj/deleteProject',
		method: 'post',
		data,
	});
}

export function apiUpdateProject(data) {
	return axios({
		url: '/api/proj/updateProject',
		method: 'post',
		data,
	});
}

export function apiAddProject(data) {
	return axios({
		url: '/api/proj/addProject',
		method: 'post',
		data,
	});
}